// 导入路由器
import VueRouter from "vue-router";
// 导入路由组件
import sign from '@/pages/sign.vue'
import system from '@/pages/system.vue'
import weather from '@/pages/weather.vue'
import show from '@/pages/show.vue'
import control from '@/pages/control.vue'


const router = new VueRouter({
    routes: [
        { path: '/', redirect: '/sign' },
        {
            path: '/sign',
            component: sign,

            // 可以配置多个子路由
        },
        {
            path: '/system',
            component: system,
            // 可以配置多个子路由
            children: [{
                name: 'weather',   //给路由组件取个名字就可以不用path，用name来取代路径
                path: 'weather',  //子路由中的path不需要/，会自动给我们加上
                component: weather,  //注册子路由组件
            }, {
                name: 'show',
                path: 'show',
                component: show,
            },
            {
                name: 'control',
                path: 'control',
                component: control,
            }]
        }]
})
router.afterEach(() => {
    document.title = '基于物联网的花卉种植系统'
})
export default router